--- a/src/stream.c
+++ b/src/stream.c
@@ -92,6 +92,9 @@
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
+#endif
 #include <netdb.h>
 #endif
 
